package cqrtplm.mapper;


import com.alibaba.fastjson.JSONObject;
import cqrtplm.dto.RTClassifyTreeDTO;
import cqrtplm.dto.RTProductDevelopmentOrderDTO;
import cqrtplm.entity.RTProductDevelopmentOrderDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Value;

import java.math.BigInteger;
import java.util.List;

@Mapper
public interface RTClassificationMapper {


    void updateProductClassify(@Param("classId") BigInteger classId, @Param("masteredoid")BigInteger masteredoid);

    String queryProductName(BigInteger oid);

    void insertProductOrder(RTProductDevelopmentOrderDTO rtProductDevelopmentOrderDTO);

    @Deprecated
    void updateClassFiciation(RTClassifyTreeDTO rtClassifyTreeDTO);

    String selectMaxSequenceNumber(String productLineCode);

    BigInteger getRootIdByClassificationId(BigInteger parentID);

    void updateClassificationParent(@Param("oid")BigInteger oid, @Param("parentID")BigInteger parentID, @Param("newRootId")BigInteger newRootId);

    List<BigInteger> findAllDescendantIds(BigInteger oid);

    void batchUpdateRootId(@Param("descendantIds")List<BigInteger> descendantIds,@Param("newRootId") BigInteger newRootId);
    @Deprecated
    void updateClassificationLevels(BigInteger parentID);

    List<RTProductDevelopmentOrderDO> selectRtCfgProductDevelopmentOrderList(RTProductDevelopmentOrderDO entity);

    List<JSONObject> selectPartNameByClassCode(@Param("classCode") String classCode);

    List<String> queryAllProductLine(BigInteger parentoid);

    BigInteger selectIbaGroupId(@Value("key") String key);

    boolean selectPartByTypeAndName(@Param("productSpectrumType") String productSpectrumType,@Param("name") String name,@Param("partOid") String partOid);

    BigInteger getParentClassByChildClassId(@Param("childId") String childId);


}
